namespace Framework.Library.Core.Utils.Miscellaneous
{
    public static class NumberUtils
    {
        public static int? AttemptConvertInt(string value)
        {
            int result;

            if (int.TryParse(value, out result))
            {
                return result;
            }

            return null;
        }

        public static decimal? AttemptConvertDecimal(string value)
        {
            decimal result;

            if (decimal.TryParse(value, out result))
            {
                return result;
            }

            return null;
        }

        public static double? AttemptConvertDouble(string value)
        {
            double result;

            if (double.TryParse(value, out result))
            {
                return result;
            }

            return null;
        }
    }
}